{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# IF ELIF and ELSE "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "I will go to college\n"
     ]
    }
   ],
   "source": [
    "Corona = False \n",
    "\n",
    "if Corona == False :\n",
    "    print(\"I will go to college\")\n",
    "else:\n",
    "    print(\"I shoudl learn online\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "I will go and take care of paitiances rather than develop Vac.\n"
     ]
    }
   ],
   "source": [
    "# iAmDoc = \"Nope\"\n",
    "# iAmDoc = \"Yes\"\n",
    "iAmDoc = \"Partially\"\n",
    "\n",
    "if iAmDoc == \"Nope\":\n",
    "    print(\"I will wait for someone to find the vaccine\")\n",
    "elif iAmDoc == \"Partially\":\n",
    "    print(\"I will go and take care of paitiances rather than develop Vac.\")\n",
    "else:\n",
    "    print(\"I will go and get the vaccine developed\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hey Input you message hey\n",
      "<class 'str'>\n",
      "The message which got recorded hey\n"
     ]
    }
   ],
   "source": [
    "# How to get Input in Python ?\n",
    "\n",
    "\n",
    "# By default Input returns String \n",
    "\n",
    "ourInputText = input(\"Hey Input you message \")\n",
    "\n",
    "print(type(ourInputText))\n",
    "\n",
    "print(\"The message which got recorded\", ourInputText)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Enter ur number - 56.7\n",
      "56.7\n",
      "<class 'float'>\n"
     ]
    }
   ],
   "source": [
    "# How to convert Str into Int or Float ??\n",
    "\n",
    "anyNumber = float(input(\"Enter ur number - \")) # this is known as Type Casting \n",
    "print(anyNumber)\n",
    "print(type(anyNumber))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# For Loops "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " Usain Bolt is running at -  1\n",
      "a is true \n",
      " Usain Bolt is running at -  2\n",
      "a is true \n",
      " Usain Bolt is running at -  3\n",
      "a is true \n",
      " Usain Bolt is running at -  4\n",
      "a is true \n",
      " Usain Bolt is running at -  5\n",
      "a is true \n",
      " Usain Bolt is running at -  6\n",
      "a is true \n",
      " Usain Bolt is running at -  7\n",
      "a is true \n",
      " Usain Bolt is running at -  8\n",
      "a is true \n",
      " Usain Bolt is running at -  9\n",
      "a is true \n",
      " Usain Bolt is running at -  10\n",
      "a is true \n",
      " Usain Bolt is running at -  11\n",
      "a is true \n",
      " Usain Bolt is running at -  12\n",
      "a is true \n",
      " Usain Bolt is running at -  13\n",
      "a is true \n",
      " Usain Bolt is running at -  14\n",
      "a is true \n",
      " Usain Bolt is running at -  15\n",
      "a is true \n",
      " Usain Bolt is running at -  16\n",
      "a is true \n",
      " Usain Bolt is running at -  17\n",
      "a is true \n",
      " Usain Bolt is running at -  18\n",
      "a is true \n",
      " Usain Bolt is running at -  19\n",
      "a is true \n",
      " Usain Bolt is running at -  20\n",
      "a is true \n",
      " Usain Bolt is running at -  21\n",
      "a is true \n",
      " Usain Bolt is running at -  22\n",
      "a is true \n",
      " Usain Bolt is running at -  23\n",
      "a is true \n",
      " Usain Bolt is running at -  24\n",
      "a is true \n",
      " Usain Bolt is running at -  25\n",
      "a is true \n",
      " Usain Bolt is running at -  26\n",
      "a is true \n",
      " Usain Bolt is running at -  27\n",
      "a is true \n",
      " Usain Bolt is running at -  28\n",
      "a is true \n",
      " Usain Bolt is running at -  29\n",
      "a is true \n",
      " Usain Bolt is running at -  30\n",
      "a is true \n",
      " Usain Bolt is running at -  31\n",
      "a is true \n",
      " Usain Bolt is running at -  32\n",
      "a is true \n",
      " Usain Bolt is running at -  33\n",
      "a is true \n",
      " Usain Bolt is running at -  34\n",
      "a is true \n",
      " Usain Bolt is running at -  35\n",
      "a is true \n",
      " Usain Bolt is running at -  36\n",
      "a is true \n",
      " Usain Bolt is running at -  37\n",
      "a is true \n",
      " Usain Bolt is running at -  38\n",
      "a is true \n",
      " Usain Bolt is running at -  39\n",
      "a is true \n",
      " Usain Bolt is running at -  40\n",
      "a is true \n",
      " Usain Bolt is running at -  41\n",
      "a is true \n",
      " Usain Bolt is running at -  42\n",
      "a is true \n",
      " Usain Bolt is running at -  43\n",
      "a is true \n",
      " Usain Bolt is running at -  44\n",
      "a is true \n",
      " Usain Bolt is running at -  45\n",
      "a is true \n",
      " Usain Bolt is running at -  46\n",
      "a is true \n",
      " Usain Bolt is running at -  47\n",
      "a is true \n",
      " Usain Bolt is running at -  48\n",
      "a is true \n",
      " Usain Bolt is running at -  49\n",
      "a is true \n",
      " Usain Bolt is running at -  50\n",
      "a is true \n",
      " Usain Bolt is running at -  51\n",
      "a is true \n",
      " Usain Bolt is running at -  52\n",
      "a is true \n",
      " Usain Bolt is running at -  53\n",
      "a is true \n",
      " Usain Bolt is running at -  54\n",
      "a is true \n",
      " Usain Bolt is running at -  55\n",
      "a is true \n",
      " Usain Bolt is running at -  56\n",
      "a is true \n",
      " Usain Bolt is running at -  57\n",
      "a is true \n",
      " Usain Bolt is running at -  58\n",
      "a is true \n",
      " Usain Bolt is running at -  59\n",
      "a is true \n",
      " Usain Bolt is running at -  60\n",
      "a is true \n",
      " Usain Bolt is running at -  61\n",
      "a is true \n",
      " Usain Bolt is running at -  62\n",
      "a is true \n",
      " Usain Bolt is running at -  63\n",
      "a is true \n",
      " Usain Bolt is running at -  64\n",
      "a is true \n",
      " Usain Bolt is running at -  65\n",
      "a is true \n",
      " Usain Bolt is running at -  66\n",
      "a is true \n",
      " Usain Bolt is running at -  67\n",
      "a is true \n",
      " Usain Bolt is running at -  68\n",
      "a is true \n",
      " Usain Bolt is running at -  69\n",
      "a is true \n",
      " Usain Bolt is running at -  70\n",
      "a is true \n",
      " Usain Bolt is running at -  71\n",
      "a is true \n",
      " Usain Bolt is running at -  72\n",
      "a is true \n",
      " Usain Bolt is running at -  73\n",
      "a is true \n",
      " Usain Bolt is running at -  74\n",
      "a is true \n",
      " Usain Bolt is running at -  75\n",
      "a is true \n",
      " Usain Bolt is running at -  76\n",
      "a is true \n",
      " Usain Bolt is running at -  77\n",
      "a is true \n",
      " Usain Bolt is running at -  78\n",
      "a is true \n",
      " Usain Bolt is running at -  79\n",
      "a is true \n",
      " Usain Bolt is running at -  80\n",
      "a is true \n",
      " Usain Bolt is running at -  81\n",
      "a is true \n",
      " Usain Bolt is running at -  82\n",
      "a is true \n",
      " Usain Bolt is running at -  83\n",
      "a is true \n",
      " Usain Bolt is running at -  84\n",
      "a is true \n",
      " Usain Bolt is running at -  85\n",
      "a is true \n",
      " Usain Bolt is running at -  86\n",
      "a is true \n",
      " Usain Bolt is running at -  87\n",
      "a is true \n",
      " Usain Bolt is running at -  88\n",
      "a is true \n",
      " Usain Bolt is running at -  89\n",
      "a is true \n",
      " Usain Bolt is running at -  90\n",
      "a is true \n",
      " Usain Bolt is running at -  91\n",
      "a is true \n",
      " Usain Bolt is running at -  92\n",
      "a is true \n",
      " Usain Bolt is running at -  93\n",
      "a is true \n",
      " Usain Bolt is running at -  94\n",
      "a is true \n",
      " Usain Bolt is running at -  95\n",
      "a is true \n",
      " Usain Bolt is running at -  96\n",
      "a is true \n",
      " Usain Bolt is running at -  97\n",
      "a is true \n",
      " Usain Bolt is running at -  98\n",
      "a is true \n",
      " Usain Bolt is running at -  99\n",
      "a is true \n",
      " Usain Bolt is running at -  100\n",
      "a is true \n",
      " Usain Bolt is running at -  101\n",
      "a is true \n",
      " Usain Bolt is running at -  102\n",
      "a is true \n",
      " Usain Bolt is running at -  103\n",
      "a is true \n",
      " Usain Bolt is running at -  104\n",
      "a is true \n",
      " Usain Bolt is running at -  105\n",
      "a is true \n",
      " Usain Bolt is running at -  106\n",
      "a is true \n",
      " Usain Bolt is running at -  107\n",
      "a is true \n",
      " Usain Bolt is running at -  108\n",
      "a is true \n",
      " Usain Bolt is running at -  109\n",
      "a is true \n",
      " Usain Bolt is running at -  110\n",
      "a is true \n",
      " Usain Bolt is running at -  111\n",
      "a is true \n",
      " Usain Bolt is running at -  112\n",
      "a is true \n",
      " Usain Bolt is running at -  113\n",
      "a is true \n",
      " Usain Bolt is running at -  114\n",
      "a is true \n",
      " Usain Bolt is running at -  115\n",
      "a is true \n",
      " Usain Bolt is running at -  116\n",
      "a is true \n",
      " Usain Bolt is running at -  117\n",
      "a is true \n",
      " Usain Bolt is running at -  118\n",
      "a is true \n",
      " Usain Bolt is running at -  119\n",
      "a is true \n",
      " Usain Bolt is running at -  120\n",
      "a is true \n",
      " Usain Bolt is running at -  121\n",
      "a is true \n",
      " Usain Bolt is running at -  122\n",
      "a is true \n",
      " Usain Bolt is running at -  123\n",
      "a is true \n",
      " Usain Bolt is running at -  124\n",
      "a is true \n",
      " Usain Bolt is running at -  125\n",
      "a is true \n",
      " Usain Bolt is running at -  126\n",
      "a is true \n",
      " Usain Bolt is running at -  127\n",
      "a is true \n",
      " Usain Bolt is running at -  128\n",
      "a is true \n",
      " Usain Bolt is running at -  129\n",
      "a is true \n",
      " Usain Bolt is running at -  130\n",
      "a is true \n",
      " Usain Bolt is running at -  131\n",
      "a is true \n",
      " Usain Bolt is running at -  132\n",
      "a is true \n",
      " Usain Bolt is running at -  133\n",
      "a is true \n",
      " Usain Bolt is running at -  134\n",
      "a is true \n",
      " Usain Bolt is running at -  135\n",
      "a is true \n",
      " Usain Bolt is running at -  136\n",
      "a is true \n",
      " Usain Bolt is running at -  137\n",
      "a is true \n",
      " Usain Bolt is running at -  138\n",
      "a is true \n",
      " Usain Bolt is running at -  139\n",
      "a is true \n",
      " Usain Bolt is running at -  140\n",
      "a is true \n",
      " Usain Bolt is running at -  141\n",
      "a is true \n",
      " Usain Bolt is running at -  142\n",
      "a is true \n",
      " Usain Bolt is running at -  143\n",
      "a is true \n",
      " Usain Bolt is running at -  144\n",
      "a is true \n",
      " Usain Bolt is running at -  145\n",
      "a is true \n",
      " Usain Bolt is running at -  146\n",
      "a is true \n",
      " Usain Bolt is running at -  147\n",
      "a is true \n",
      " Usain Bolt is running at -  148\n",
      "a is true \n",
      " Usain Bolt is running at -  149\n",
      "a is true \n",
      " Usain Bolt is running at -  150\n",
      "a is true \n",
      " Usain Bolt is running at -  151\n",
      "a is true \n",
      " Usain Bolt is running at -  152\n",
      "a is true \n",
      " Usain Bolt is running at -  153\n",
      "a is true \n",
      " Usain Bolt is running at -  154\n",
      "a is true \n",
      " Usain Bolt is running at -  155\n",
      "a is true \n",
      " Usain Bolt is running at -  156\n",
      "a is true \n",
      " Usain Bolt is running at -  157\n",
      "a is true \n",
      " Usain Bolt is running at -  158\n",
      "a is true \n",
      " Usain Bolt is running at -  159\n",
      "a is true \n",
      " Usain Bolt is running at -  160\n",
      "a is true \n",
      " Usain Bolt is running at -  161\n",
      "a is true \n",
      " Usain Bolt is running at -  162\n",
      "a is true \n",
      " Usain Bolt is running at -  163\n",
      "a is true \n",
      " Usain Bolt is running at -  164\n",
      "a is true \n",
      " Usain Bolt is running at -  165\n",
      "a is true \n",
      " Usain Bolt is running at -  166\n",
      "a is true \n",
      " Usain Bolt is running at -  167\n",
      "a is true \n",
      " Usain Bolt is running at -  168\n",
      "a is true \n",
      " Usain Bolt is running at -  169\n",
      "a is true \n",
      " Usain Bolt is running at -  170\n",
      "a is true \n",
      " Usain Bolt is running at -  171\n",
      "a is true \n",
      " Usain Bolt is running at -  172\n",
      "a is true \n",
      " Usain Bolt is running at -  173\n",
      "a is true \n",
      " Usain Bolt is running at -  174\n",
      "a is true \n",
      " Usain Bolt is running at -  175\n",
      "a is true \n",
      " Usain Bolt is running at -  176\n",
      "a is true \n",
      " Usain Bolt is running at -  177\n",
      "a is true \n",
      " Usain Bolt is running at -  178\n",
      "a is true \n",
      " Usain Bolt is running at -  179\n",
      "a is true \n",
      " Usain Bolt is running at -  180\n",
      "a is true \n",
      " Usain Bolt is running at -  181\n",
      "a is true \n",
      " Usain Bolt is running at -  182\n",
      "a is true \n",
      " Usain Bolt is running at -  183\n",
      "a is true \n",
      " Usain Bolt is running at -  184\n",
      "a is true \n",
      " Usain Bolt is running at -  185\n",
      "a is true \n",
      " Usain Bolt is running at -  186\n",
      "a is true \n",
      " Usain Bolt is running at -  187\n",
      "a is true \n",
      " Usain Bolt is running at -  188\n",
      "a is true \n",
      " Usain Bolt is running at -  189\n",
      "a is true \n",
      " Usain Bolt is running at -  190\n",
      "a is true \n",
      " Usain Bolt is running at -  191\n",
      "a is true \n",
      " Usain Bolt is running at -  192\n",
      "a is true \n",
      " Usain Bolt is running at -  193\n",
      "a is true \n",
      " Usain Bolt is running at -  194\n",
      "a is true \n",
      " Usain Bolt is running at -  195\n",
      "a is true \n",
      " Usain Bolt is running at -  196\n",
      "a is true \n",
      " Usain Bolt is running at -  197\n",
      "a is true \n",
      " Usain Bolt is running at -  198\n",
      "a is true \n",
      " Usain Bolt is running at -  199\n",
      "a is true \n",
      " Usain Bolt is running at -  200\n",
      "a is true \n",
      "-------*******-------\n",
      "Usain had tocuched down the Finish line-  200\n",
      "-------*******-------\n"
     ]
    }
   ],
   "source": [
    "# Work hard untill u achie the goal !!\n",
    "\n",
    "# Usain Bolt Run until he touches the finsih line at 200 Meteres\n",
    "\n",
    "# i = item from itretable \n",
    "# range function  is there for generating the sequence of numbers in list\n",
    "# else part in for - just as the loop ends it will terminate via else part\n",
    "a = True \n",
    "for i in range (1,201):\n",
    "    print(\" Usain Bolt is running at - \", i ) \n",
    "    if a == True :\n",
    "        print(\"a is true \")\n",
    "    else:\n",
    "        print(\"a is false\")\n",
    "\n",
    "else:\n",
    "    print(\"-------*******-------\")\n",
    "    print(\"Usain had tocuched down the Finish line- \", i)\n",
    "    print(\"-------*******-------\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "# how range function works \n",
    "lst = list(range(1,201))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[1,\n",
       " 2,\n",
       " 3,\n",
       " 4,\n",
       " 5,\n",
       " 6,\n",
       " 7,\n",
       " 8,\n",
       " 9,\n",
       " 10,\n",
       " 11,\n",
       " 12,\n",
       " 13,\n",
       " 14,\n",
       " 15,\n",
       " 16,\n",
       " 17,\n",
       " 18,\n",
       " 19,\n",
       " 20,\n",
       " 21,\n",
       " 22,\n",
       " 23,\n",
       " 24,\n",
       " 25,\n",
       " 26,\n",
       " 27,\n",
       " 28,\n",
       " 29,\n",
       " 30,\n",
       " 31,\n",
       " 32,\n",
       " 33,\n",
       " 34,\n",
       " 35,\n",
       " 36,\n",
       " 37,\n",
       " 38,\n",
       " 39,\n",
       " 40,\n",
       " 41,\n",
       " 42,\n",
       " 43,\n",
       " 44,\n",
       " 45,\n",
       " 46,\n",
       " 47,\n",
       " 48,\n",
       " 49,\n",
       " 50,\n",
       " 51,\n",
       " 52,\n",
       " 53,\n",
       " 54,\n",
       " 55,\n",
       " 56,\n",
       " 57,\n",
       " 58,\n",
       " 59,\n",
       " 60,\n",
       " 61,\n",
       " 62,\n",
       " 63,\n",
       " 64,\n",
       " 65,\n",
       " 66,\n",
       " 67,\n",
       " 68,\n",
       " 69,\n",
       " 70,\n",
       " 71,\n",
       " 72,\n",
       " 73,\n",
       " 74,\n",
       " 75,\n",
       " 76,\n",
       " 77,\n",
       " 78,\n",
       " 79,\n",
       " 80,\n",
       " 81,\n",
       " 82,\n",
       " 83,\n",
       " 84,\n",
       " 85,\n",
       " 86,\n",
       " 87,\n",
       " 88,\n",
       " 89,\n",
       " 90,\n",
       " 91,\n",
       " 92,\n",
       " 93,\n",
       " 94,\n",
       " 95,\n",
       " 96,\n",
       " 97,\n",
       " 98,\n",
       " 99,\n",
       " 100,\n",
       " 101,\n",
       " 102,\n",
       " 103,\n",
       " 104,\n",
       " 105,\n",
       " 106,\n",
       " 107,\n",
       " 108,\n",
       " 109,\n",
       " 110,\n",
       " 111,\n",
       " 112,\n",
       " 113,\n",
       " 114,\n",
       " 115,\n",
       " 116,\n",
       " 117,\n",
       " 118,\n",
       " 119,\n",
       " 120,\n",
       " 121,\n",
       " 122,\n",
       " 123,\n",
       " 124,\n",
       " 125,\n",
       " 126,\n",
       " 127,\n",
       " 128,\n",
       " 129,\n",
       " 130,\n",
       " 131,\n",
       " 132,\n",
       " 133,\n",
       " 134,\n",
       " 135,\n",
       " 136,\n",
       " 137,\n",
       " 138,\n",
       " 139,\n",
       " 140,\n",
       " 141,\n",
       " 142,\n",
       " 143,\n",
       " 144,\n",
       " 145,\n",
       " 146,\n",
       " 147,\n",
       " 148,\n",
       " 149,\n",
       " 150,\n",
       " 151,\n",
       " 152,\n",
       " 153,\n",
       " 154,\n",
       " 155,\n",
       " 156,\n",
       " 157,\n",
       " 158,\n",
       " 159,\n",
       " 160,\n",
       " 161,\n",
       " 162,\n",
       " 163,\n",
       " 164,\n",
       " 165,\n",
       " 166,\n",
       " 167,\n",
       " 168,\n",
       " 169,\n",
       " 170,\n",
       " 171,\n",
       " 172,\n",
       " 173,\n",
       " 174,\n",
       " 175,\n",
       " 176,\n",
       " 177,\n",
       " 178,\n",
       " 179,\n",
       " 180,\n",
       " 181,\n",
       " 182,\n",
       " 183,\n",
       " 184,\n",
       " 185,\n",
       " 186,\n",
       " 187,\n",
       " 188,\n",
       " 189,\n",
       " 190,\n",
       " 191,\n",
       " 192,\n",
       " 193,\n",
       " 194,\n",
       " 195,\n",
       " 196,\n",
       " 197,\n",
       " 198,\n",
       " 199,\n",
       " 200]"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lst"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# While Loops "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " GO Corona\n",
      "Enter the status of corona - n\n",
      " GO Corona\n",
      "Enter the status of corona - n\n",
      " GO Corona\n",
      "Enter the status of corona - n\n",
      " GO Corona\n",
      "Enter the status of corona - n\n",
      " GO Corona\n",
      "Enter the status of corona - y\n",
      " India and everyone of us WON the Battle !\n"
     ]
    }
   ],
   "source": [
    "# GO CORONA GO \n",
    "\n",
    "coronaThere = True \n",
    "\n",
    "while coronaThere == True:\n",
    "    print(\" GO Corona\")\n",
    "    abc = input(\"Enter the status of corona - \")\n",
    "    if abc[0].lower() == 'y':\n",
    "        coronaThere = False\n",
    "else: # Terimnation block/ Exit Block in Python\n",
    "    print( \" India and everyone of us WON the Battle !\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'g'"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "abc = \"GO CORONA\"\n",
    "\n",
    "abc[0].lower()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Break, Pass & Continue"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Number -  1\n",
      "Number -  2\n",
      "Number -  3\n"
     ]
    }
   ],
   "source": [
    "# 1. break \n",
    "\n",
    "\n",
    "for i in range(1,10):\n",
    "    if(i == 4):\n",
    "        break\n",
    "    print('Number - ',i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Number -  1\n",
      "Number -  2\n",
      "Number -  3\n",
      "Number -  5\n",
      "Number -  6\n",
      "Number -  7\n",
      "Number -  8\n",
      "Number -  9\n"
     ]
    }
   ],
   "source": [
    "#2.  What does continue do ?\n",
    "\n",
    "for i in range(1,10):\n",
    "    if(i == 4):\n",
    "        continue\n",
    "    print(\"Number - \", i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "unexpected EOF while parsing (<ipython-input-42-9d97122b5071>, line 6)",
     "output_type": "error",
     "traceback": [
      "\u001b[0;36m  File \u001b[0;32m\"<ipython-input-42-9d97122b5071>\"\u001b[0;36m, line \u001b[0;32m6\u001b[0m\n\u001b[0;31m    # What can i, if i leave it like this and run what will happen?\u001b[0m\n\u001b[0m                                                                   ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m unexpected EOF while parsing\n"
     ]
    }
   ],
   "source": [
    "# Pass - \n",
    "\n",
    "for i in range(1,10):\n",
    "    # i dont know right now what to right here, \n",
    "    # But i know that this loop has to be there \n",
    "    # What can i, if i leave it like this and run what will happen?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Pass - \n",
    "for i in range(1,10):\n",
    "    pass\n",
    "    # i dont know right now what to right here,\n",
    "    # But i know that this loop has to be there \n",
    "    # What can i, if i leave it like this and run what will happen?\n",
    "    # we use pass a the placeholder to just make\n",
    "    # sure our program dont give us error"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [],
   "source": [
    "# computer generated randomly a number 179 \n",
    "\n",
    "# a player has to input a number between 179-10 or 179+10 \n",
    "\n",
    "# 169 and 189 ( if a player is putting up a number \n",
    "#between those u print \"You are true Indian cricket team  fan \")\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# File Handling !"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<_io.TextIOWrapper name='FCS.txt' mode='w' encoding='UTF-8'>\n"
     ]
    }
   ],
   "source": [
    "# Lets create a new file \n",
    "\n",
    "file = open(\"FCS.txt\",'w')\n",
    "\n",
    "print(file)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [],
   "source": [
    "# how to write anything in the file \n",
    "\n",
    "file = open(\"FCS.txt\",'w')\n",
    "\n",
    "file.write(\"Hey Hi guys I Am loving teaching u all \")\n",
    "\n",
    "# u need to close the file before the program ends to save it \n",
    "# properly\n",
    "file.close()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hey Hi guys I Am loving teaching u all \n"
     ]
    }
   ],
   "source": [
    "# How to read from a file \n",
    "\n",
    "file = open(\"FCS.txt\",\"r\")\n",
    "text = file.read()\n",
    "print(text)\n",
    "file.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [],
   "source": [
    "# How can we add a new line to the file \n",
    "\n",
    "file = open(\"FCS.txt\",'a')\n",
    "\n",
    "text = file.write(\"\\n\\nWe are appending the file\")\n",
    "\n",
    "file.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hey Hi guys I Am loving teaching u all \n",
      "\n",
      " We are appending the file\n",
      "\n",
      "We are appending the file\n"
     ]
    }
   ],
   "source": [
    "# How to read from a file \n",
    "\n",
    "file = open(\"FCS.txt\",\"r\")\n",
    "text = file.read()\n",
    "print(text)\n",
    "file.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hey Hi guys I Am loving teaching u all \n",
      "\n",
      " We are appending the file\n",
      "\n",
      "We are appending the file\n"
     ]
    }
   ],
   "source": [
    "# Lets use With() Function, \n",
    "\n",
    "with open(\"FCS.txt\",'r') as f :\n",
    "    print(f.read())\n",
    "#     f.close() --- Dont need to do this stuff as it closes by its own\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
